package com.glory.gloryquickui.view

import android.content.Context
import android.view.View
import android.widget.TextView
import com.glory.gloryquickui.R
import com.glory.gloryquickui.entity.FieldBean

/**
 *文本框组件
 */
class TextViewController(context: Context?) : ViewController<FieldBean?>(context) {
    private var tvTextName: TextView? = null
    private var tvTextValue: TextView? = null
    override fun resLayoutId(): Int {
        return R.layout.layout_text
    }

    override fun onBindView(data: FieldBean?) {
        tvTextName!!.text = data?.config?.label
        tvTextValue!!.hint = data?.placeholder
    }

    override fun onCreatedView(view: View?) {
        tvTextName = view?.findViewById(R.id.tvTextName)
        tvTextValue = view?.findViewById(R.id.tvTextValue)
    }

    override fun masterPart(): View? {
        return tvTextValue
    }
}